<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./移动端登录.css">
    <!-- 引入jq -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<body>
    <div class="title">
        <a href="./移动端我.html">
            <button>&lt;</button>
        </a>
        <h4>登录</h4>
    </div>
    <div class="title1">
        <img src="./img/21.gif" alt="">
    </div>
    <div class="main">
        <input type="text" placeholder="请输入手机号" class="name">
        <br>
        <input type="text" placeholder="请输入密码" class="password"> 
        <span>找回密码</span>
        <input type="text" placeholder="验证码" class="vercode">
    </div>
    <div class="main1">
        <button class="login">登录</button>
        <button class="enroll">新用户注册</button>
    </div>
</body>
<script>
    $(function(){
        $('#login').click(login)
    })
    function login(){
        let vercode = $('#vercode').val()
        let name = $('#name').val()
        let pwd = $('#password').val()
        $.ajax({
            url: 'http://47.94.4.201/index.php/index/index/login',
            type: 'post',
            dataType: 'json',
            data: {
                vercode:vercode,
                name:name,
                pwd:pwd
            },
            success: function(res){
                console.log(res);
                // if (res) {}
            }
        })
    }
</script>
</html>